//package com.wiloon.java8x.refactor;
//
//import java.util.Enumeration;
//import java.util.Vector;
//
///**
// * Created by wiloon on 1/23/17;
// */
//public class Customer {
//    private String _name;
//    private Vector _rentals = new Vector();
//
//    public Customer(String name) {
//        _name = name;
//    }
//
//    public void addRental(Rental arg) {
//        _rentals.addElement(arg);
//    }
//
//    public String getName() {
//        return _name;
//    }
//
//    public String htmlStatement(){
//        String result = "<H1>Rentals for <EM>"+getName()+"</EM><?H1><P>\n";
//        Enumeration rentals = _rentals.elements();
//        while (rentals.hasMoreElements()) {
//            Rental each = (Rental) rentals.nextElement();
//            result += "\t" + each.getMovie().getTitle() + "\t" + String.valueOf(each.getCharge()) + "\n";
//
//        }
//        // add footer lines
//        result += "html resutl ... Amount owed is " + String.valueOf(getTotalCharge()) + "\n";
//        result += "You earned " + String.valueOf(getFrequentRenterPoints()) +
//                " frequent renter points";
//        return result;
//    }
//    public String statement() {
//
//        Enumeration rentals = _rentals.elements();
//        String result = "Rental Record for " + getName() + "\n";
//
//        while (rentals.hasMoreElements()) {
//            Rental each = (Rental) rentals.nextElement();
//            // show figures for this rental
//            result += "\t" + each.getMovie().getTitle() + "\t" + String.valueOf(each.getCharge()) + "\n";
//
//        }
//
//        // add footer lines
//        result += "Amount owed is " + String.valueOf(getTotalCharge()) + "\n";
//        result += "You earned " + String.valueOf(getFrequentRenterPoints()) +
//                " frequent renter points";
//        return result;
//    }
//
//    private double getFrequentRenterPoints() {
//
//        double result = 0;
//        Enumeration rentals = _rentals.elements();
//
//        while (rentals.hasMoreElements()) {
//            Rental each = (Rental) rentals.nextElement();
//            result += each.getFrequentRenterPoints();
//        }
//        return result;
//
//
//
//    }
//
//    private double getTotalCharge() {
//        double result = 0;
//        Enumeration rentals = _rentals.elements();
//
//        while (rentals.hasMoreElements()) {
//            Rental each = (Rental) rentals.nextElement();
//            result += each.getCharge();
//        }
//        return result;
//    }
//
//}
